package com.itheima.dome;

import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

public class SetDome {
    public static void main(String[] args) {
        Set<String> setList=new HashSet<>();
        setList.add("刘备");
        setList.add("关羽");
        setList.add("张飞");
        setList.add("刘备");
        Iterator<String> iterator=setList.iterator();
        while (iterator.hasNext()) {
            String next =  iterator.next();
            System.out.println(next.toString());
        }
        System.out.println("---------");
        for (String s : setList) {
            System.out.println(s.toString());
        }
    }
}
